import React from 'react';
import Button from './Button';

export default React.createClass({
    getInitialState: function () {
        return {
            count: 1000
        }
    },
    doClick: function () {
        this.refs.stuffButton.getStuff();
    },
    cusClick: function () {
        this.setState({
            count: ++this.state.count
        });
        console.log('area', this.state.count)
    },
    render: function () {
        return (
            <div>
                <Button ref="stuffButton" cusClick={this.cusClick}></Button>
                <h3>
                    <button disabled={this.state.count>1000?'disabled': ''} onClick={this.doClick}>another button</button>
                </h3>
            </div>
        );
    }
});